package com.gufe.mapper.admin.joinArmy;

import com.github.pagehelper.Page;
import com.gufe.dto.adminJoinArmy.PageJoinArmyMemberDTO;
import com.gufe.entity.ArmyMember;
import com.gufe.entity.PrecollectMember;
import com.gufe.vo.adminJoinArmy.PageJoinArmyMemberVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface JoinArmyMapper {

    @Select("SELECT COUNT(*) from army_member;")
    Integer getTotalCount();

    Page<PageJoinArmyMemberVO> pageJoinArmyMember(PageJoinArmyMemberDTO pjamd);

    void newJoinArmyMember(ArmyMember armyMember);

    @Select("SELECT * from precollect_members where student_id=#{i};")
    PrecollectMember gettest(String i);

    //根据入伍使时间查询入伍人数
    @Select("SELECT COUNT(*) from army_member where join_army_date >= #{startDate} && join_army_date <= #{endDate};")
    Integer getJoinArmyFromDate(String startDate, String endDate);

    int insertArmyMember(List<ArmyMember> armyMemberList);

    ArmyMember getArmyPersonBasicInfo(String id);

}
